﻿using System;

namespace AnimalLadyApp
{
    // 1. 定义抽象类Animal
    abstract class Animal
    {
        public string Name { get; set; }

        protected Animal(string name)
        {
            Name = name;
        }

        public abstract void Enjoy();
    }

    // 2. 定义Cat类
    class Cat : Animal
    {
        public string EyesColor { get; set; }

        public Cat(string name, string eyesColor) : base(name)
        {
            EyesColor = eyesColor;
        }

        public override void Enjoy()
        {
            Console.WriteLine($"{Name}（眼睛颜色：{EyesColor}）高兴地\"喵喵\"叫，并在阳光下打滚");
        }
    }

    // 3. 定义Dog类
    class Dog : Animal
    {
        public string FurColor { get; set; }

        public Dog(string name, string furColor) : base(name)
        {
            FurColor = furColor;
        }

        public override void Enjoy()
        {
            Console.WriteLine($"{Name}（毛发颜色：{FurColor}）兴奋地\"汪汪\"叫，并摇着尾巴");
        }
    }

    // 4. 定义Lady类
    class Lady
    {
        public string Name { get; set; }
        public Animal Pet { get; set; }

        public Lady(string name, Animal pet)
        {
            Name = name;
            Pet = pet;
        }

        public void MyPetEnjoy()
        {
            Console.Write($"{Name}的宠物");
            Pet.Enjoy();
        }
    }

    // 5. 测试类
    class Program
    {
        static void Main(string[] args)
        {
            // 创建张女士和她的猫
            Cat zhangsCat = new Cat("小花", "蓝色");
            Lady zhangLady = new Lady("张女士", zhangsCat);
            zhangLady.MyPetEnjoy();

            // 创建王女士和她的狗
            Dog wangsDog = new Dog("大黄", "金黄色");
            Lady wangLady = new Lady("王女士", wangsDog);
            wangLady.MyPetEnjoy();
        }
    }
}